package net.API.IssueLemon.display;

import javax.swing.*;
import java.awt.*;
import java.awt.geom.Path2D;
import java.awt.*;
import java.awt.RenderingHints;

import static javax.swing.SwingUtilities.getRoot;
import static javax.swing.SwingUtilities.paintComponent;
import static net.API.IssueLemon.display.Display.frame;
import static net.API.IssueLemon.display.Display.root;

public class tx {

    // repaint() 方法重绘窗口
    public static void Line(Graphics g,int x, int y, int x1, int y1){
        g.drawLine(x, y, x1, y1);
        frame.repaint();
    }
    public static void Rect(Graphics g, int x, int y, int x1, int y1) {
        g.drawRect(x, y, x1, y1);
        frame.repaint();
    }
    public static void Triangle(Graphics g, int x, int y, int x1, int y1, int x2, int y2){
        int[] ax = {x, x1, x2};
        int[] ay = {y, y1, y2};
        g.drawPolygon(ax, ay, 3);
        frame.repaint();
    }
    public static void Paint(Graphics g,
        int x,
        int y,
        int width,
        int height,
        int startAngle,
        int arcAngle
        ) {
        g.drawArc(x, y, width, height, startAngle, arcAngle);
        frame.repaint();
    }
    public static void RegisterTextArea(String s, int x, int y, int w, int h){
        JTextArea textArea = new JTextArea(s);
        textArea.setBounds(x, y, w, h);
        frame.add(textArea);
        frame.repaint();
    }
    public static void RegisterText(String s, int x, int y, int w ,int h){
        JTextPane textPane = new JTextPane();
        textPane.setEditable(false);
        textPane.setBounds(x,y,w,h);
        textPane.setText(s);
        frame.add(textPane);
        frame.repaint();
    }
    //public static void MovingSubtitles(char c, int sleep_){
    //    if (c == 'a' || c == 'A'){
    //
    //    }
    //}
}
